<script type="text/javascript" src="<?php echo $this->baseUrl() ?>/public/js/kk_countdown_1_2_jquery_min.js"></script>
<?php foreach($this->products as $product): ?>
<?php 
	$date = new DateTime($product->created);
	//$date->add(new DateInterval("P{$product->avaiable_time}D"));
	$date->modify("+{$product->avaiable_time} day");
	$today = new DateTime();
	$tmp = strtotime($date->format("y-m-d G:i:s")) - strtotime($today->format("y-m-d G:i:s"));
	
	$hour = floor($tmp / 3600);
	$min = floor(($tmp%3600)/60);
	$sec = $tmp - $hour*3600 - $min*60;
?>
<div class="hot_pro">
	<div class="grid_6 hot_pro_img">
		<img src="<?php echo $this->baseUrl('/public/upload/thumbs/').$product->img1 ?>" alt="<?php echo $product->title ?>" title="<?php echo $product->title ?>" witdh="230" height="172"/>
		<div class="hot_pro_bar">
			<div class="left" id="p<?php echo $product->id ?>"><span time="<?php echo strtotime($date->format("y-m-d G:i:s"))?>" class="kkcount-down"></span></div>
			<div class="right">200 PTZ</div>
		</div>
		<a href="#" class="hot_pro_des">
			<div id="description">
				<?php echo $product->title ?><br/><br/>
				Opening bid: <?php echo $product->start_price ?> PTZ<br/>
				Current bid: 150 PTZ<br/>
				Your bid: 200 PTZ
			</div>	
		</a>					
	</div>
</div>
<script type="text/javascript">
	$(document).ready(function(){
        $("#p<?php echo $product->id ?>").kkCountDown({
			colorText: '#666'
        });
    });
</script>
<?php endforeach ?>
